#ifndef DATE_H
#define DATE_H


class Date
{
    public:
        Date();
        Date(char strDate[]);
        Date(int Y,int M,int D);
        void setDate(int Y,int M,int D);
        void show() const;
        int getYear();
        void setYear(int Y);
        int getMonth();
        void setMonth(int Y);
        int getDay();
        void setDay(int Y);
        char * toString();
        int daysPerMonth(int m=-1) const;
        int daysPerYear(int m=-1) const;
        int compare(const Date &date) const;
        bool isLeapYear(int y=-1) const;
        virtual ~Date();
        int subDate(const Date &date)const;
        Date addDays(int days) const;
        Date subDays(int days) const;


    private:
        int year,month,day;
        void addOneDay();

        void subOneDay()
{
    if(--day<1)
    {
        if(--month<1)
        {
            month=12;year--;
        }
day=daysPerMonth();
    }
}
        int subSmallDate(const Date &dat) const;
};

#endif // DATE_H
